Form Builder

Contact Form Example

<form action="/infomaxim/json/saveform.asp" class="ajax-form" data-message-class="colors-e background-95 border heading" method="post" novalidate="novalidate">
    <input name="form_name" style="display: none" type="hidden" value="form_requests" />
    <input name="table_name" style="display: none" type="hidden" value="aurora_customers" />
    <input name="table_name" style="display: none" type="hidden" value="aurora_case" />
    <input name="aurora_case_type_id" style="display: none" type="hidden" value="1" />
    <input name="form_action" style="display: none" type="hidden" value="insertExec" />
    <div class="row">
        <div class="col-md-6 control-group">
            <div class="alt-placeholder">
                Name</div>
            <input data-validation-required-message="Please fill the required field." name="aurora_customers_firstname" placeholder="Name" required="" size="40" type="text" value="">
            <div class="help-block">
            </div>
        </div>
        <div class="col-md-6 control-group">
            <div class="alt-placeholder">
                Email</div>
            <input data-validation-required-message="Please fill the required field." name="aurora_customers_email" placeholder="Email" required="" size="40" type="email" value="">
            <div class="help-block">
            </div>
        </div>
        <div class="col-md-12 control-group">
            <div class="alt-placeholder">
                Message</div>
            <textarea data-validation-required-message="Please fill the required field." name="aurora_case_detail" placeholder="Message" required=""></textarea>
            <div class="help-block">
            </div>
        </div>
        <div class="col-md-12 form-actions">
            <input class="button" type="submit" value="Send"> </div>
    </div>
</form>

Basic Requirements

  1. Form action
    action="/infomaxim/json/saveform.asp"
  2. Form name
    <input name="form_name" style="display: none" type="hidden" value="form_requests" />
  3. Table name
    <input name="table_name" style="display: none" type="hidden" value="aurora_customers" />
  4. Form action
    <input name="form_action" style="display: none" type="hidden" value="insertExec" />
  5. Form fields – name must be field name
    <input data-validation-required-message="Please fill the required field." name="aurora_customers_firstname" placeholder="Name" required="" size="40" type="text" value="">

Multi-type forms

A single form post can achieve complex table insertions and relationship creation:-
 
1. link a record from another table
2. create multiple records in multiple other tables
 
It's all done simply using the form field names
For example for an enquiry, the actual message is now a Case in Aurora_Cases and is managed from the admin using Customers/Contacts
 
When you want to save a record in another table with some fields from the form
you need to add a second table definition
 
<input name="table_name" style="display: none" type="hidden" value="aurora_case"/>
 
Make sure this is AFTER the main table - in this instance aurora_customers
Now Infomaxim will look for fields prefixed with aurora_case_ and store these fields in a new case record
any new records created from a form post after the main table are automtically linked to the main table - nothing to do there
the other scenario is if someone subscribes
 
<input name="table_name" style="display: none" type="hidden" value="aurora_case"/>?
 
Multiple tables can have data stored in them from one form post.
 
Simple name the fields accordingly:-
 
name="{table_name}_{field_name}"
 
all tables after the first are linked to the first using aurora_related
for this to work in the admin, the table you are posting to second must be designated as a child table in Admin > Config > Tables
this is the case with aurora_case for example already by default
the other scenario is linking a record
 
this would be used to:-
1. Add areas of interest
2. Add products of interest
3. Subscribe a user to a newsletter
etc.
in this case you are linking an existing row to the main record using aurora_related
this is done first by stating the table to link
 
<input name="table_name" style="display: none" type="hidden" value="link_aurora_publications"/>

 
so, it's just link_{table_name} as the value for a table_name
then you need to tell what to link - this would always be a checkbox (it's either linked or ignored if not checked)
 
the second bit is the ID of the item to link
<input name="link_aurora_publications_id" type="hidden" value="1">

in this case its a hidden field, but it could be a checkbox, with the value set to the ID if it is checked of course
 
linked items can have attributes - there are 3 bit fields in each linked row we can use for different things
in the case of a subscription, the first of these determines if the status of the subscription
<input name="aurora_related_aurora_publications_attr1" type="checkbox" value="1">

so this is just a field value in the usual format

 

Redirection

One a form is submitted in can optionally force redirection to another page.

This can be controlled from the FORM using the form_redirect field name with a value of the target URL.

If this field is not present the form handler will use the do_redirect parameter passed to the function, as follows:-

PublicForm({do_redirect})

The redirection is also controlled by the force_redirect variable, which is set to 1 when the PublicForm function is called.

2 redirects to aurora_dynamic, and is mostly used internally within the Infomaxim admin.

3 does no redirection

4 redirects to aurora_data_index_dynamic

If this value is not set, the form will redirect as follows:-

If the form was storing a child record, it will redirect to aurora_linked

If the step variable is set the form will reload the current edit controller and try to redirect to the corresponding tab

If all the above are false, the form will redirect to aurora_data_index_dyanamic.

In each case, a set of parameters are persisted from the form post to the redirection URL.

 

Purpose

Report authors can create reports which generate forms using a drag and drop authoring tool which enables:-

Fields – any field included in the report query

Labels – a free text box

Boxes – a graphic element

Lines – a graphic elements – horizontal or vertical

Images – from the image library / or imported on demand

to be dropped onto an A4 form canvas. Each element will have properties enabling abstract elements to be linked to fields, or contain derived values such as the

Sums

Averages

Counts

Multiplication

Division

Percentage

The resulting form can be printed from a query which would populate the form.

Footer and Header

 

comments powered by Disqus